import requests from "@/utils/oaRequest"


//http://localhost:8080/jeecg-boot/sys/position/list?_t=1666312688&column=createTime&order=desc&field=id,,,code,name,postRank_dictText,action&pageNo=1&pageSize=10

export const getPositionList = ((data) =>requests(
    {
        url:`/sys/position/list?_t=1666312688&column=createTime&order=desc`,
        method:'GET',
        params:data
    }
))

//http://localhost:8080/jeecg-boot/sys/position/add
//jeecg-boot/sys/position/add 增加
export const addPosition = (data =>requests(
    {
        url:`/sys/position/add`,
        method:'post',
        data
    }
))
//http://localhost:8080/jeecg-boot/sys/position/delete?id=1583338262230736897
export const delPosition = ((id) =>requests(
    {
        url:`/sys/position/delete?id=${id}`,
        method:'delete',

    }
))



//http://localhost:8080/jeecg-boot/sys/position/edit
export const editPosition = ((data) =>requests(
    {
        url:`/sys/position/edit`,
        method:'put',
        data
    }
))

//ttp://localhost:8080/jeecg-boot/sys/position/deleteBatch?ids=1583390253879402497,1583387395385729025,
export const deleteBatchPosition = ((ids) =>requests(
    {
        url:`/sys/position/deleteBatch?ids=${ids}`,
        method:'delete',
       
    }
))

//: http://localhost:8080/jeecg-boot/sys/position/exportXls?_t=1666349459&column=createTime&order=desc&field=id,,,code,name,postRank_dictText,action&pageNo=1&pageSize=10
export const exportXls = (data) =>requests(
    {
        url:`/sys/position/exportXls?_t=1666349459&column=createTime&order=desc&field=id,,,code,name,postRank_dictText,action&pageNo=1&pageSize=10`,
        method:'GET',
        data,
        responseType:'blob',
    }
)
//Custom check
//http://localhost:8080/jeecg-boot/sys/duplicate/check?_t=1666350409&tableName=sys_position&fieldName=code&fieldVal=assadasd
export const duplicateCheck = (data) =>requests(
    {
        url:`/sys/duplicate/check?_t=1666350409&tableName=sys_position&fieldName=code&fieldVal=${data}`,
        method:'GET',

    }
)